package com.example.user.controller;

import com.example.common.core.controller.BaseController;
import com.example.common.core.domain.R;
import com.example.common.core.enums.UserIdentity;
import com.example.user.aspect.CheckUserIdentity;
import com.example.user.domain.curriculumSchedule.dto.CurriculumScheduleQueryDTO;
import com.example.user.service.ICurriculumScheduleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@RestController
@RequestMapping("/curriculumSchedule")
public class CurriculumScheduleController extends BaseController {
    @Autowired
    private ICurriculumScheduleService curriculumScheduleService;

    @GetMapping("/teacher/get")
    @CheckUserIdentity(identity = UserIdentity.TEACHER)
    public R<Map<Integer, String[]>> teacherGet(CurriculumScheduleQueryDTO curriculumScheduleQueryDTO) {
        return R.ok(curriculumScheduleService.teacherGet(curriculumScheduleQueryDTO));
    }

    @GetMapping("/student/get")
    @CheckUserIdentity(identity = UserIdentity.STUDENT)
    public R<Map<Integer, String[]>> studentGet(CurriculumScheduleQueryDTO curriculumScheduleQueryDTO) {
        return R.ok(curriculumScheduleService.studentGet(curriculumScheduleQueryDTO));
    }
}
